package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   折扣品牌<br>
 *<br>
 * 数据表： discount_brand
 *
 */
@Description({"折扣品牌"})
public class DiscountBrand implements Serializable {
    /**
     *
     *   折扣品牌Id    <br>
     *<br>
     * 字段名： discount_brand.BrandId
     */
    @Description({"折扣品牌Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer brandId;

    /**
     *
     *   品牌类型;充值/券/卡    <br>
     *<br>
     * 字段名： discount_brand.BrandMode
     */
    @Description({"品牌类型;充值/券/卡", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer brandMode;

    /**
     *
     *   名称    <br>
     *<br>
     * 字段名： discount_brand.Name
     */
    @Description({"名称", "不能为空", "数据长度: 100"})
    @NonNull
    private String name;

    /**
     *
     *   副标题    <br>
     *<br>
     * 字段名： discount_brand.SubTitle
     */
    @Description({"副标题", "数据长度: 20"})
    private String subTitle;

    /**
     *
     *   Logo    <br>
     *<br>
     * 字段名： discount_brand.Logo
     */
    @Description({"Logo", "不能为空", "数据长度: 190"})
    @NonNull
    private String logo;

    /**
     *
     *   展示图    <br>
     *<br>
     * 字段名： discount_brand.Image
     */
    @Description({"展示图", "数据长度: 190"})
    private String image;

    /**
     *
     *   是否是新的    <br>
     *<br>
     * 字段名： discount_brand.IsNew
     */
    @Description({"是否是新的", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean isNew;

    /**
     *
     *   权重; 降序    <br>
     *<br>
     * 字段名： discount_brand.Weight
     */
    @Description({"权重; 降序", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer weight;

    /**
     *
     *   状态: 上线, 下线    <br>
     *<br>
     * 字段名： discount_brand.Status
     */
    @Description({"状态: 上线, 下线", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer status;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_brand.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_brand.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_brand.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_brand.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_brand.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   折扣品牌Id    <br>
     *<br>
     * 字段名： discount_brand.BrandId
     */
    public Integer getBrandId() {
        return brandId;
    }

    /**
     * 设置参数<br><br>
     *
     *   折扣品牌Id<br>
     *<br>
     * 字段名： discount_brand.BrandId
     */
    public void setBrandId(Integer brandId) {
        this.brandId = brandId;
    }

    /**
     * 获取参数<br><br>
     *
     *   品牌类型;充值/券/卡    <br>
     *<br>
     * 字段名： discount_brand.BrandMode
     */
    public Integer getBrandMode() {
        return brandMode;
    }

    /**
     * 设置参数<br><br>
     *
     *   品牌类型;充值/券/卡<br>
     *<br>
     * 字段名： discount_brand.BrandMode
     */
    public void setBrandMode(Integer brandMode) {
        this.brandMode = brandMode;
    }

    /**
     * 获取参数<br><br>
     *
     *   名称    <br>
     *<br>
     * 字段名： discount_brand.Name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置参数<br><br>
     *
     *   名称<br>
     *<br>
     * 字段名： discount_brand.Name
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   副标题    <br>
     *<br>
     * 字段名： discount_brand.SubTitle
     */
    public String getSubTitle() {
        return subTitle;
    }

    /**
     * 设置参数<br><br>
     *
     *   副标题<br>
     *<br>
     * 字段名： discount_brand.SubTitle
     */
    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle == null ? null : subTitle.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   Logo    <br>
     *<br>
     * 字段名： discount_brand.Logo
     */
    public String getLogo() {
        return logo;
    }

    /**
     * 设置参数<br><br>
     *
     *   Logo<br>
     *<br>
     * 字段名： discount_brand.Logo
     */
    public void setLogo(String logo) {
        this.logo = logo == null ? null : logo.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   展示图    <br>
     *<br>
     * 字段名： discount_brand.Image
     */
    public String getImage() {
        return image;
    }

    /**
     * 设置参数<br><br>
     *
     *   展示图<br>
     *<br>
     * 字段名： discount_brand.Image
     */
    public void setImage(String image) {
        this.image = image == null ? null : image.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   是否是新的    <br>
     *<br>
     * 字段名： discount_brand.IsNew
     */
    public Boolean getIsNew() {
        return isNew;
    }

    /**
     * 设置参数<br><br>
     *
     *   是否是新的<br>
     *<br>
     * 字段名： discount_brand.IsNew
     */
    public void setIsNew(Boolean isNew) {
        this.isNew = isNew;
    }

    /**
     * 获取参数<br><br>
     *
     *   权重; 降序    <br>
     *<br>
     * 字段名： discount_brand.Weight
     */
    public Integer getWeight() {
        return weight;
    }

    /**
     * 设置参数<br><br>
     *
     *   权重; 降序<br>
     *<br>
     * 字段名： discount_brand.Weight
     */
    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    /**
     * 获取参数<br><br>
     *
     *   状态: 上线, 下线    <br>
     *<br>
     * 字段名： discount_brand.Status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置参数<br><br>
     *
     *   状态: 上线, 下线<br>
     *<br>
     * 字段名： discount_brand.Status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_brand.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： discount_brand.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_brand.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： discount_brand.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_brand.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： discount_brand.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_brand.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： discount_brand.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_brand.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： discount_brand.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        brandId("BrandId", "brandId", "INTEGER", false),
        brandMode("BrandMode", "brandMode", "INTEGER", false),
        name("Name", "name", "VARCHAR", true),
        subTitle("SubTitle", "subTitle", "VARCHAR", false),
        logo("Logo", "logo", "VARCHAR", false),
        image("Image", "image", "VARCHAR", false),
        isNew("IsNew", "isNew", "BIT", false),
        weight("Weight", "weight", "INTEGER", false),
        status("Status", "status", "INTEGER", true),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false),
        describe("Describe", "describe", "LONGVARCHAR", true),
        parameters("Parameters", "parameters", "LONGVARCHAR", true);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}